import tkinter as tk
from tkinter import messagebox


class application(tk.Frame):
    def __init__(self,master=None):
        self.master=master
        super().__init__(master)
        self.creatWidget()

    def creatWidget(self):
        self.btn01=tk.Button(self.master,text='hit me',command=self.show)
        self.btn01.pack()

    def show(self):
        a=messagebox.askquestion("hit me",'please hit me')
        print(a)


window=tk.Tk()
window.geometry('1000x300')
window.config(background='blue')
app=application(window)
window.mainloop()